
function error(err, req, res, next) {
	// console.log("------------------------------------------------");
	// console.log("error--req.url:",req.url,"err.name :",err.name ,"err.message",err.message)
	// console.log("------------------------------------------------");
	if (err.name === 'UnauthorizedError') {
		return res.send({
			code: 401,
			message: "无效token"
		})
	}
	res.send({
		code: 500,
		message:err.message|| "未知错误"
	})
}

module.exports = error;